package com.ruoyi.cat.service.impl;

import java.util.List;

import com.ruoyi.cat.domain.AdTicketImage;
import com.ruoyi.cat.mapper.AdTicketImageMapper;
import com.ruoyi.cat.service.IAdTicketImageService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 折扣图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-16
 */
@Service
public class AdTicketImageServiceImpl implements IAdTicketImageService
{
    @Autowired
    private AdTicketImageMapper adTicketImageMapper;

    /**
     * 查询折扣图片
     * 
     * @param id 折扣图片主键
     * @return 折扣图片
     */
    @Override
    public AdTicketImage selectAdTicketImageById(Long id)
    {
        return adTicketImageMapper.selectAdTicketImageById(id);
    }

    /**
     * 查询折扣图片列表
     * 
     * @param adTicketImage 折扣图片
     * @return 折扣图片
     */
    @Override
    public List<AdTicketImage> selectAdTicketImageList(AdTicketImage adTicketImage)
    {
        return adTicketImageMapper.selectAdTicketImageList(adTicketImage);
    }

    /**
     * 新增折扣图片
     * 
     * @param adTicketImage 折扣图片
     * @return 结果
     */
    @Override
    public int insertAdTicketImage(AdTicketImage adTicketImage)
    {
        adTicketImage.setCreateTime(DateUtils.getNowDate());
        return adTicketImageMapper.insertAdTicketImage(adTicketImage);
    }

    /**
     * 修改折扣图片
     * 
     * @param adTicketImage 折扣图片
     * @return 结果
     */
    @Override
    public int updateAdTicketImage(AdTicketImage adTicketImage)
    {
        return adTicketImageMapper.updateAdTicketImage(adTicketImage);
    }

    /**
     * 批量删除折扣图片
     * 
     * @param ids 需要删除的折扣图片主键
     * @return 结果
     */
    @Override
    public int deleteAdTicketImageByIds(Long[] ids)
    {
        return adTicketImageMapper.deleteAdTicketImageByIds(ids);
    }

    /**
     * 删除折扣图片信息
     * 
     * @param id 折扣图片主键
     * @return 结果
     */
    @Override
    public int deleteAdTicketImageById(Long id)
    {
        return adTicketImageMapper.deleteAdTicketImageById(id);
    }
}
